import React from "react";
import "./App.css";
import Test1 from "./components/test1.js";
import { connect } from "react-redux";

class App extends React.Component {
  render() {
    return (
      <div className="App">
        <header className="App-header">
          <div>Redux count:{this.props.count}</div>
          <Test1 />
        </header>
      </div>
    );
  }
}
//把全局redux状态映射到本组件state当中
const mapStateToProps = (state) => {
  return {
    count: state.countReducer.count,
  };
};
export default connect(mapStateToProps)(App);
